﻿using UnityEngine;
using System.Collections;

/// <summary>
/// Unity Log Handler
/// 140203 hikim
/// </summary>
public class LogHandler : MonoBehaviour {

    void OnEnable()
    {
        Application.RegisterLogCallback(HandleLog);
    }

    void OnDisable()
    {
        Application.RegisterLogCallback(null);
    }

    void HandleLog(string logString, string stackTrace, LogType type)
    {
        switch (type)
        {
            case LogType.Error:
            //case LogType.Exception:
                {
                    //SimpleCommonPopup popup = PopupManager.Inst.Open<SimpleCommonPopupError>();
                    //popup.Desc = logString + "\n" + stackTrace;
                }
                break;
        }
    }
}
